<template>
  <!--轮播图-->
  <swiper>
    <swiper-item v-for="item of banner" :key="item.image">
      <a :href="item.link">
        <img :src="item.image" alt="">
      </a>

    </swiper-item>
  </swiper>
</template>

<script>
  // 使用的时候二合一
  // import {Swiper} from '../../components/common/swiper/Swiper'
  // import {SwiperItem} from '../../components/common/swiper/SwiperItem'
  import {Swiper, SwiperItem} from 'components/common/swiper'

  export default {
    name: "HomeSwiper",
    props:{
      banner:{
        type:Array,
        // 数组默认值，用函数返回数组
        default(){
          return []
        }
      }
    },
    components: {
      Swiper,
      SwiperItem,
    }
  }
</script>

<style scoped>

</style>
